<!doctype html>
<html>
    <head>
        <title>AudioTrackList &amp; VideoTrackList after load()</title>
        <script src="../../resources/testharness.js"></script>
        <script src="../../resources/testharnessreport.js"></script>
            </head>
    <body>
        <script>
            async_test(function(t)
            {
                var video = document.createElement("video");
                video.src = "../content/test.ogv";

                video.addEventListener("loadedmetadata", t.step_func_done(function()
                {

                    assert_equals(video.audioTracks.length, 1, "audioTracks.length");
                    assert_equals(video.videoTracks.length, 1, "videoTracks.length");
                    assert_equals(video.videoTracks.selectedIndex, 0, "videoTracks.selectedIndex");

                    video.load();

                    assert_equals(video.audioTracks.length, 0, "audioTracks.length");
                    assert_equals(video.videoTracks.length, 0, "videoTracks.length");
                    assert_equals(video.videoTracks.selectedIndex, -1, "videoTracks.selectedIndex");
                }));
            });
        </script>
    </body>
</html>
